{include file="layout/header" title="客服设置" /}
<div class="view-body">
    {include file="layout/menu" /}
    <div class="view-product">
        <div class="company_identify">
            <div class="manage-head">
                <h6 class="padding-left manage-head-con">
                    客服设置
                </h6>
            </div>
            <div class="layui-lr-20 margin-top-25 clearfix">
                <form action="{:url('admin/Config/service')}" class="layui-form" id="serviceForm" method="post">
                    {volist name="service" id="v"}
                    <div class="layui-form-item margin-left-300 service-tpl">
                        <div class="layui-form-mid">
                            客服名称：
                        </div>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input class="layui-input" lay-verify="required" name="service[{$i}][name]" type="text" value="{$v.name}">
                            </input>
                        </div>
                        <div class="layui-form-mid">
                            手机号：
                        </div>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input class="layui-input" lay-verify="required" name="service[{$i}][mobile]" type="text" value="{$v.mobile}">
                            </input>
                        </div>
                        <div class="layui-form-mid">
                            qq号：
                        </div>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input class="layui-input" lay-verify="required" name="service[{$i}][qq]" type="text" value="{$v.qq}">
                            </input>
                        </div>
                        <div class="layui-form-mid">
                            微信号：
                        </div>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input class="layui-input" lay-verify="required" name="service[{$i}][wechat]" type="text" value="{$v.wechat|default=''}">
                            </input>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn layui-btn-primary del-service">
                                <i class="layui-icon">
                                    
                                </i>
                            </button>
                        </div>
                    </div>
                    {/volist}
                    <div class="layui-form-item margin-left-300">
                        <div class="layui-input-block" style="margin-left: 80px;">
                            <button class="layui-btn layui-btn-normal" lay-filter="serviceYes" lay-submit="">
                                确定
                            </button>
                            <button class="layui-btn layui-btn-primary" id="addService">
                                <i class="layui-icon">
                                    
                                </i>
                                添加一个客服
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.del-service').live('click',function(){
				$(this).parent().parent().remove();
				layer.msg('删除成功！');
				return false;
			});

			$('#addService').click(function(){
				var i = $(".service-tpl").length + 1;
				var tpl = '<div class="layui-form-item margin-left-300 service-tpl">'+
									'<div class="layui-form-mid">客服名称：</div>'+
									'<div class="layui-input-inline" style="width: 150px;">'+
									'<input type="text" name="service['+i+'][name]" lay-verify="required" class="layui-input"></div>'+
									'<div class="layui-form-mid">手机号：</div>'+
									'<div class="layui-input-inline" style="width: 150px;">'+
									'<input type="text" name="service['+i+'][mobile]" lay-verify="required" class="layui-input"></div>'+
									'<div class="layui-form-mid">qq号：</div>'+
									'<div class="layui-input-inline" style="width: 150px;">'+
									'<input type="text" name="service['+i+'][qq]" lay-verify="required" class="layui-input"></div>'+
									'<div class="layui-form-mid">微信号：</div>'+
									'<div class="layui-input-inline" style="width: 150px;">'+
									'<input type="text" name="service['+i+'][wechat]" lay-verify="required" class="layui-input"></div>'+
									'<div class="layui-input-inline"><button class="layui-btn layui-btn-primary del-service">'+
									'<i class="layui-icon">&#xe640;</i></button></div></div>';
				if(i == 1){
					$("#serviceForm").prepend(tpl);
					return false;
				}
				$(".service-tpl:last").after(tpl);
				return false;
			});
</script>
{include file="layout/footer" /}
